//class ObjectParser

export class ObjectParser {
  public static toClass(arg1: any, Ctor: { new (): any }) {
    var loc1 = new Ctor();
    ObjectParser.putObject(arg1, loc1);
    return loc1;
  }

  public static putObject(arg1: any, arg2: any): void {
    var loc1 = undefined;
    var loc2 = 0;
    var loc3 = arg1;
    for (loc1 in loc3) {
      if (!arg2.hasOwnProperty(loc1)) {
        continue;
      }
      arg2[loc1] = arg1[loc1];
    }
  }

  public static duplicate(arg1: any): Object {
    var loc2 = undefined;
    var loc1: any = {};
    var loc3 = 0;
    var loc4 = arg1;
    for (loc2 in loc4) {
      loc1[loc2] = arg1[loc2];
    }
    return loc1;
  }

  public static getClassVars(data: any) {
    return Object.keys(data);
  }
}
